package etnorservice.etnor_service.emus;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2025/03/19/20:39
 **/


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.STRING)
public enum AuthType {
    NONE,
    PASSWORD,
    TOKEN,
    SSH;

    @JsonCreator
    public static AuthType fromString(String value) {
        if (value == null) {
            return null;
        }
        try {
            return AuthType.valueOf(value.toUpperCase());
        } catch (IllegalArgumentException e) {
            return null; // 或者返回一个默认值，比如 NONE
        }
    }
}